#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

class Solution {
public:
    int findContentChildren(vector<int>& g, vector<int>& s) { 
        sort(g.begin(), g.end());
        sort(s.begin(), s.end());
        int child = 0;
        int index = s.size() - 1; 
        for(int i = g.size() - 1; i >= 0; i--){ 
            if(index >= 0 && s[index] >= g[i]){
                index--;
                child++;
            }
        }
        return child;
    }
};

int main()
{
    Solution sol;
    vector<int> g = {1,2,3};
    vector<int> s = {};
    
    cout << sol.findContentChildren(g, s) << endl;
    return 0;
}